]> dgit.raspbian.org Git - ostree.git/commit
generator: Fix soft-reboot for var, sysroot, and boot
authorJoseph Marrero Corchado <jmarrero@redhat.com>
Tue, 7 Apr 2026 19:24:45 +0000 (15:24 -0400)
committerJoseph Marrero Corchado <jmarrero@redhat.com>
Tue, 7 Apr 2026 19:25:37 +0000 (15:25 -0400)
commita88e66eaf86a3c7b0060073757c02245196f759d
treea95b6eb317d3e58347d699d04cdcbccf3b8d28f5
parent2ae8f95c3138f399f039df62ff5b5db68b059435
generator: Fix soft-reboot for var, sysroot, and boot

A bare `systemctl soft-reboot` on ostree/bootc systems was broken in
several ways because the generator and prepare-root were not accounting
for the fact that soft-reboot does not re-run the initramfs.

The var.mount unit had DefaultDependencies=yes, which pulled in implicit
After= dependencies on device units. After soft-reboot, these device
units get stuck in 'tentative' state while udev restarts, causing
var.mount to stall indefinitely. Fix this by setting
DefaultDependencies=no with explicit ordering After=local-fs-pre.target
sysroot.mount.

For /sysroot, systemd auto-generates the mount unit from mountinfo with
Conflicts=umount.target, causing it to be unmounted during soft-reboot
shutdown. Generate a drop-in with DefaultDependencies=no to prevent this.
We use a drop-in because the generator does not know the What= device
parameter — systemd gets that from mountinfo.

For /boot on same-partition setups, move the bind-mount from
ostree-prepare-root into the generator as a full boot.mount unit with
DefaultDependencies=no. This handles normal boot, bare soft-reboot, and
staged deployment soft-reboot uniformly. The static (non-systemd) path
in ostree-prepare-root-static.c retains its own bind-mount since the
generator does not run there.

Validated with plain disk and RAID1 kola tests on FCOS 43.

Fixes: https://issues.redhat.com/browse/RHEL-154075
Assisted-by: OpenCode (Claude Opus 4.6)
Signed-off-by: Joseph Marrero Corchado <jmarrero@redhat.com>
src/libostree/ostree-impl-system-generator.c
src/switchroot/ostree-prepare-root-static.c
src/switchroot/ostree-prepare-root.c
tests-unit-container/test-prepare-root.sh
tests/kolainst/destructive/soft-reboot.sh